package dbms.check;

import dbms.Debug;
import dbms.server.DbmsServer;

public class CheckAttr {
	String attr;
	String table;
	
	public CheckAttr(String a, String t) {
		attr = a;
		table = t;
	}
	
	public boolean HasAttr() {
		return DbmsServer.masterPage.tableMap.get(table).table.getTableSchema().getFieldRank().containsKey(attr);
	}
	
	public void check() {
		if (!HasAttr()) Debug.Error("Attribute:" + attr + "does not exists!");
	}
}
